
package se.sll.service.catalogue.offers.api.model;

import java.util.HashMap;
import java.util.Map;
import javax.annotation.Generated;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import org.codehaus.jackson.annotate.JsonAnyGetter;
import org.codehaus.jackson.annotate.JsonAnySetter;
import org.codehaus.jackson.annotate.JsonCreator;
import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.annotate.JsonPropertyOrder;
import org.codehaus.jackson.annotate.JsonValue;
import org.codehaus.jackson.map.annotate.JsonSerialize;


/**
 * A contact preference
 * 
 */
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
@Generated("org.jsonschema2pojo")
@JsonPropertyOrder({
    "type",
    "iCalendar",
    "value",
    "validDatePeriod",
    "comment"
})
public class ContactPreference {

    /**
     * 
     * (Required)
     * 
     */
    @JsonProperty("type")
    @NotNull
    private ContactPreference.Type type;
    /**
     * 
     * (Required)
     * 
     */
    @JsonProperty("iCalendar")
    @NotNull
    private String iCalendar;
    /**
     * 
     */
    @JsonProperty("value")
    private String value;
    /**
     * A Date Period Type
     * 
     */
    @JsonProperty("validDatePeriod")
    @Valid
    private DatePeriod validDatePeriod;
    /**
     * 
     */
    @JsonProperty("comment")
    private String comment;
    @JsonIgnore
    private Map<String, Object> additionalProperties = new HashMap<String, Object>();

    /**
     * 
     * (Required)
     * 
     * @return
     *     The type
     */
    @JsonProperty("type")
    public ContactPreference.Type getType() {
        return type;
    }

    /**
     * 
     * (Required)
     * 
     * @param type
     *     The type
     */
    @JsonProperty("type")
    public void setType(ContactPreference.Type type) {
        this.type = type;
    }

    public ContactPreference withType(ContactPreference.Type type) {
        this.type = type;
        return this;
    }

    /**
     * 
     * (Required)
     * 
     * @return
     *     The iCalendar
     */
    @JsonProperty("iCalendar")
    public String getICalendar() {
        return iCalendar;
    }

    /**
     * 
     * (Required)
     * 
     * @param iCalendar
     *     The iCalendar
     */
    @JsonProperty("iCalendar")
    public void setICalendar(String iCalendar) {
        this.iCalendar = iCalendar;
    }

    public ContactPreference withICalendar(String iCalendar) {
        this.iCalendar = iCalendar;
        return this;
    }

    /**
     * 
     * @return
     *     The value
     */
    @JsonProperty("value")
    public String getValue() {
        return value;
    }

    /**
     * 
     * @param value
     *     The value
     */
    @JsonProperty("value")
    public void setValue(String value) {
        this.value = value;
    }

    public ContactPreference withValue(String value) {
        this.value = value;
        return this;
    }

    /**
     * A Date Period Type
     * 
     * @return
     *     The validDatePeriod
     */
    @JsonProperty("validDatePeriod")
    public DatePeriod getValidDatePeriod() {
        return validDatePeriod;
    }

    /**
     * A Date Period Type
     * 
     * @param validDatePeriod
     *     The validDatePeriod
     */
    @JsonProperty("validDatePeriod")
    public void setValidDatePeriod(DatePeriod validDatePeriod) {
        this.validDatePeriod = validDatePeriod;
    }

    public ContactPreference withValidDatePeriod(DatePeriod validDatePeriod) {
        this.validDatePeriod = validDatePeriod;
        return this;
    }

    /**
     * 
     * @return
     *     The comment
     */
    @JsonProperty("comment")
    public String getComment() {
        return comment;
    }

    /**
     * 
     * @param comment
     *     The comment
     */
    @JsonProperty("comment")
    public void setComment(String comment) {
        this.comment = comment;
    }

    public ContactPreference withComment(String comment) {
        this.comment = comment;
        return this;
    }

    @JsonAnyGetter
    public Map<String, Object> getAdditionalProperties() {
        return this.additionalProperties;
    }

    @JsonAnySetter
    public void setAdditionalProperty(String name, Object value) {
        this.additionalProperties.put(name, value);
    }

    public ContactPreference withAdditionalProperty(String name, Object value) {
        this.additionalProperties.put(name, value);
        return this;
    }

    @Generated("org.jsonschema2pojo")
    public static enum Type {

        TELEPHONE_PROFESSIONAL("TELEPHONE_PROFESSIONAL"),
        TELEPHONE_CITIZEN("TELEPHONE_CITIZEN"),
        EMAIL("EMAIL"),
        MVK("MVK"),
        TELEPHONE_SWITCHBOARD("TELEPHONE_SWITCHBOARD"),
        TELEPHONE_CANCELLATION("TELEPHONE_CANCELLATION"),
        TELEPHONE_BOOKING("TELEPHONE_BOOKING"),
        TELEPHONE_EMERGENCY("TELEPHONE_EMERGENCY"),
        TELEPHONE_TEXT("TELEPHONE_TEXT"),
        FAX("FAX");
        private final String value;
        private static Map<String, ContactPreference.Type> constants = new HashMap<String, ContactPreference.Type>();

        static {
            for (ContactPreference.Type c: values()) {
                constants.put(c.value, c);
            }
        }

        private Type(String value) {
            this.value = value;
        }

        @JsonValue
        @Override
        public String toString() {
            return this.value;
        }

        @JsonCreator
        public static ContactPreference.Type fromValue(String value) {
            ContactPreference.Type constant = constants.get(value);
            if (constant == null) {
                throw new IllegalArgumentException(value);
            } else {
                return constant;
            }
        }

    }

}
